Repository navigation
fix(voice): count a run-together technical match as code evidence for the sentence - #627
Merged
Merged
Conversation
…ence for the sentence When words ran together into a longer term, the shorter exact form they passed over no longer anchored the rest of an English sentence, so ClarkCant and React beside a run-together webapp were left as heard. The passed-over form and the exact matches inside the span now count as evidence, as they would on their own; they still never support the run-together span itself. Refs #608, #613
A word a run-together term absorbed now supports only spans that did not absorb a word themselves. Such a span is rewritten only on a technical cue or a term heard in its own spelling, so "the web app and the web app" and "set up the web app for grandma" stay as heard, while "fix the clark cant web app now" still gives ClarkCant and "fix the web app react now" still restores React.
…let a span absorb A term that counts as evidence while it is itself rewritten, such as "Follow-up" heard for the tool follow-up or "S3" for s3, supports a run-together span that absorbs a word like "web". That absorbed word no longer supports lowering the term in return, so "Follow-up on the web app" keeps "Follow-up" as main does, instead of each change resting only on the other.
…dence itself A span that holds a coding cue or an evidence term already supports every run-together span outside it, so the words those spans absorbed are rewritten away. They no longer support that span in return: "the code review of the web app" keeps "code review" and "type script web app" keeps "type script", as main does.
Contributor
Author
|
Review attestation: ready to merge at A push to this PR makes this attestation stale; the new head needs its own review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #621. Refs #608, #613, #590, #607.
Problem
#613 lets words that run together into a longer term win over a shorter exact form at the same position ("web app" reads as
webapp, notweb+ "app"). The shorter form was the sentence's only evidence that it was about code, so in an English sentence other corrections were dropped:Web/web,webapp):mainleft it as heard; before fix(voice): prefer a run-together compact over a shorter two-word match #613 it gaveClarkCant web app.mainleftreact; before fix(voice): prefer a run-together compact over a shorter two-word match #613 it restoredReact.Change
packages/voice-adapters/src/transcript-normalizer.tsmatchAtkeeps the exact form a run-together match passed over (passedOver), and takes an end bound.hitsBetween(from, end), so the words inside a run-together span can be matched on their own.main's evidence. They support only a span that absorbed no words itself and holds no cue or evidence term of its own. So two run-together spans cannot vouch for each other, and neither can a run-together span and a span holding evidence, such as "Follow-up" for the toolfollow-upor the cue in "code review" forcodeReview."user service api" still abstains with
userservice-api|userserviceApi, as the issue allows: the words really can be read as either.Tests
New named suite "still counts the words a run-together term absorbed as evidence for the rest of the sentence", with the three inputs from the issue. On
main(f40c8cb) theClarkCantandReacttests fail (text left as heard) and the abstention test passes, as expected. All three pass on this branch. The #590, #607 and #608 suites are unchanged and green (173/173 in voice-adapters at the current head).Differential
Harness: one script importing the #613 parent (
ac8e843e),main(f40c8cb7) and this branch side by side. Six sessions: the #608 issue vocabulary,clarkcant-webonly, the bench corpus context, a large workspace session, the case-ambiguous session, and a short-tool-plus-run-together session. Inputs: every 1 to 3 word sequence over a 47-word pool in four frames (Vietnamese, English, bare,mở file … đi), the issue's mixes, and every corpus reference and recognizer output.mainvs branch: 54 differ. All 54 are corrections the fix(voice): prefer a run-together compact over a shorter two-word match #613 parent made andmainlost, now restored with the parent's exact change (ClarkCant/clarkcantbesideweb app,next js,react native,market place,git hub,play wright;Reactbesideweb app).user service apiabstention.mainnor the parent made: this claim was wrong at86907b0c(see review B1). After review, see "Changes after review" for the re-run.Bench
pnpm --filter @clarkcant/voice-adapters bench:transcriptionoutput is byte-identical onmainand on this branch (normalized: WER 3.7%, CER 0.8%, TTER 16.2%, exact 77.4% / 84.5%, 64 changes, 1 abstained, 0 regressions). ADR-003 tables (EN and VI) already show these numbers, so they are unchanged.Verification
pnpm typecheck: cleanpnpm invariants: 14/14 passedpnpm verify: passed on the current heada08285bf(7681 passed, 37 skipped, 1 todo)No user-visible docs change: the matcher's evidence rule is internal and no doc describes it.
Changes after review
Review B1: a word absorbed by one run-together span counted as evidence for another run-together span in the same sentence, even when that span was rewritten too. Two guesses vouched for each other, for example with tool
weband packagewebapp, "the web app and the web app" became "the webapp and the webapp".mainand the #613 parent leave it as heard.transcript-normalizer.ts): absorbed anchors go to their own list. A span that itself passed over a shorter form (a run-together span that absorbed words) is supported only by technical cues and by terms heard in their own spelling, as onmain. Every other span may also use absorbed anchors. This restoresmain's invariant: a span rewritten only because the sentence looked like code never counts as evidence.ClarkCant web app, "fix the web app react now" restoresReact, and "user service api" still abstains.web+webapp), "set up the web app for grandma" and "the front end of the web app" all stay as heard. All three fail on86907b0cand pass now.mainvs this head, with the fix(voice): prefer a run-together compact over a shorter two-word match #613 parentac8e843eadded and a minimalweb/front/set+webapp/frontend/setupsession (glossary off) added: 2,743,644 normalisations, 848 differ in 17 groups. All of them are casing restorations beside "web app" (React,Electron),ClarkCantandGitHub, the same as the parent. No spacing rewrite of a run-together span remains. Cases where this head rewrites text that bothmainand the parent leave as heard: 0. That count missed outputs where each baseline makes one of two changes and the head makes both (review B2, fixed in round 2 below). Self-support isolation violations: 0. The minimal session and the glossary-only session have 0 differences. The only output matching neithermainnor the parent is "the user service api react": head givesReactand abstains on "user service api", while the parent also wroteAPI. That is the intended abstention.bench:transcription: byte-identical tomain(normalized WER 3.7%, CER 0.8%, TTER 16.2%, 64 changes, 1 abstained, 0 regressions).pnpm typecheckis clean, eslint is clean on both changed files, andpnpm invariantspasses 14/14.Round 2
Review B2: a term that counts as evidence while it is itself rewritten could support a run-together span, and then be supported in return by the word that span absorbed. With tools
follow-upandweband packagewebapp, "Follow-up on the web app" became "follow-up on the webapp". With tools3, "S3 is on the web app" became "s3 is on the webapp".mainkeeps the capital, and the parent keeps "web app".transcript-normalizer.ts): absorbed words no longer support a hit that is itself evidence. Such a term already supports every run-together span outside it, so the word that span absorbed is always rewritten away and cannot be support. Round 3 widens this from evidence terms to any hit holding a cue word. "Follow-up on the web app" now gives "Follow-up on the webapp", the same asmain.follow-up,web,webapp) and "S3 is on the web app" (s3,web,webapp) keep the capital and rewrite onlywebapp, asmaindoes. Both fail on66212bc5and pass now.follow-up/check-in/s3session, and 3-span chains), run onmain, the parentac8e843eand this head: 1,471,155 normalisations. Head outputs that match neithermainnor the parent: 0 (2,097 at66212bc5). Self-support violations: 0. The reviewer's probes still giveClarkCant web appandweb app React, theuser service apiabstention holds, and every B1 chain stays as heard.bench:transcription: byte-identical tomain. voice-adapters 171/171, including the Voice normalizer: do not re-case a term whose spelling is ambiguous by case #590, fix(voice): leave a term the vocabulary spells two ways by case as heard #607 and fix(voice): prefer a run-together compact over a shorter two-word match ('clark cant web') #608 suites.pnpm typecheckis clean, eslint is clean on both changed files, andpnpm invariantspasses 14/14.Round 3
Review N1: a coding cue inside a rewritten span and a run-together span could still support each other. With tool
web, packagewebappand symbolcodeReview, "the code review of the web app" became "the codeReview of the webapp". With the default glossary, "type script web app" became "TypeScript webapp".mainkeeps "code review" and "type script"; the parent keeps "web app".webapponly, asmaindoes. Both fail ondd667399and pass now. The issue's three results still hold.main, the parentac8e843eand this head. Head outputs that match neithermainnor the parent: 0 in both. Losses againstmain: 0 in both. Self-support violations: 0.bench:transcription: byte-identical tomain. voice-adapters 173/173.pnpm typecheckis clean, eslint is clean on both changed files,pnpm invariantspasses 14/14, andpnpm verifypasses ona08285bf(7681 passed).